package com.supcalls.controller;

import com.supcalls.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/storage")
public class StorageController {
    @Autowired
    private StorageService storageService;

    @PostMapping("/decrease")
    public void decrease(@RequestParam Long productId, @RequestParam Integer count) {
        storageService.decrease(productId, count);
    }
}
